﻿using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
using Synology.DS.Core;

namespace Synology.DS.Service
{
    [RunInstaller(true)]
    public class ServiceInstaller : Installer 
    {
        private readonly System.ServiceProcess.ServiceInstaller _serviceInstaller;
        private readonly ServiceProcessInstaller _processInstaller;

        public ServiceInstaller()
        {
            _serviceInstaller = new System.ServiceProcess.ServiceInstaller();
            _serviceInstaller.ServiceName = Const.ServiceName;
            _serviceInstaller.Description = "File watcher for synology download station";
            _serviceInstaller.StartType = ServiceStartMode.Automatic;

            _processInstaller = new ServiceProcessInstaller();
            _processInstaller.Account = ServiceAccount.LocalSystem;

            Installers.Add(_serviceInstaller);
            Installers.Add(_processInstaller);
        }
    }
}
